<#include "include/_meta.html">
<!--/meta 作为公共模版分离出去-->

<title>修改个人信息 </title>
<meta name="keywords" content="汽车租赁">
<meta name="description" content="汽车租赁">
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 系统管理 <span class="c-gray en">&gt;</span> 个人信息设置 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	
	<form class="form form-horizontal" id="form-account-edit">
		<div id="tab-system" class="HuiTab">
			<div class="tabBar cl"><span>用户资料</span><span>密码设置</span></span></div>
			<div class="tabCon">
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>账户名称：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" id="username" name="username" placeholder="账户名称" value="${(account.username)!''}" class="input-text">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>员工工号：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" id="personid" name="personid" placeholder="员工工号" value="${(account.personid)!''}" class="input-text">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>员工姓名：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" id="realname" name="realname" placeholder="员工姓名" value="${(account.realname)!''}" class="input-text">
					</div>
				</div>
			</div>
			<div class="tabCon">
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">原密码：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="password" class="input-text" placeholder="原密码" value="" id="oldpass" name="oldpass" >
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">新密码：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="password" class="input-text" placeholder="新密码" value="" id="newpass" name="newpass" >
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-2">确认密码：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="password" class="input-text" placeholder="确认密码" value="" id="confirmpass" name="confirmpass" >
					</div>
				</div>
			</div>
			<div class="row cl">
				<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
	</div>
	</form>
</div>
	
<!--/_footer /作为公共模版分离出去--> 
<#include "include/_footer.html">

<!--请在下方写此页面业务相关的脚本-->
	<script type="text/javascript">
	$(function(){
		$('.skin-minimal input').iCheck({
			checkboxClass: 'icheckbox-blue',
			radioClass: 'iradio-blue',
			increaseArea: '20%'
		});
		$.Huitab("#tab-system .tabBar span","#tab-system .tabCon","current","click","0");
		
		//对要修改的数据进行校验
		$("#form-account-edit").validate({
		rules:{
			username:{
				required:true
			},
			personid:{
				required:true
			},
			realname:{
				required:true
			},
			oldpass:{
				required:true
			},
			newpass:{
				required:true
			},
			confirmpass:{
				required:true,
				equalTo:"#newpass"
			}
		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
	   		$.ajax({
	            type: 'post', 
	            url: '/accountedit/${(account.uid)!''}', 
	            data:{
		                'username': $("#username").val(),
		                'personid': $("#personid").val(),
		                'realname': $("#realname").val(),
						'userpwd' : "${(account.userpwd)!''}",
		                'oldpass': $("#oldpass").val(),
						'newpass': $("#newpass").val()
						},
	            success:function(data){
	                if(data.false == 'false'){
	                   alert("你输入的确认密码与原密码不同....");
	                   return;
	                } 
					alert("修改成功");
	 				console.log('提交成功！');
	 				var index = parent.layer.getFrameIndex(window.name);
					//parent.$(".btn-primary").click();
					parent.layer.close(index);
	            }
	        });
		}
		});
	});
</script>
</body>
</html>